package com;

import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.bean.Course;
import com.opensymphony.xwork2.ActionSupport;
import com.service.CourseService;


public class DeleteCourseAction extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Resource(type=Course.class)
	private Course course;
	
	@Autowired
	@Qualifier("courseService")
	private  CourseService courseService;
	
	
	public static long getSerialversionuid() {
		return serialVersionUID;
	}
	@Override
	public String execute() throws Exception {
		try 
		{
			courseService.deleteCourse(course);
			return SUCCESS;
		}
		catch (Exception e) 
		{
			e.printStackTrace();
			return ERROR;
		}
	}
	

}
